package singlelist;

import java.util.Scanner;

public class Test {
    static class ListNode {
        int value;
        ListNode next;
    }

    //    以C语言的思维一次性地创建一个链表，接口型
    public static ListNode createList(ListNode head) {
        Scanner scanner = new Scanner(System.in);
        head = new ListNode();
        head.value = scanner.nextInt();
        head.next = null;

        ListNode cur = head;

        while(!scanner.hasNext("exit")) {
            ListNode newNode = new ListNode();
            newNode.value = scanner.nextInt();
            newNode.next = null;

            cur.next = newNode;
            cur = cur.next;
        }
        return head;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

    }
}